#ifndef __PID_H
#define __PID_H

//结构体定义
typedef struct
{
   	float kp,ki,kd;
    float error,lastError;
    float integral,maxIntegral;
    float output,maxOutput;
}PID;

void PID_Init(PID *pid,float p,float i,float d,float maxI,float maxOut);
void PID_Calc(PID *pid,float reference,float feedback);
float Speed_Left_control(PID *Speed_Left, float now_Speed, float goal_Speed);
float Speed_Right_control(PID *Speed_Right, float now_Speed, float goal_Speed);
float Angle_control(PID *Angle, float now_Angle, float goal_Angle);
float Distance_Left_control(PID *AnDistance_Leftgle, float now_Angle, float goal_Angle);
float Distance_Right_control(PID *Distance_Right, float now_Angle, float goal_Angle);
float Gray_control(PID *Gray, float now_Angle, float goal_Angle);
float Xiexian_Angle_control(PID *Xiexian_Angle, float now_Angle, float goal_Angle);
#endif